home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 46
/
Mobiclic46.iso
/
pc
/
DATA
/
SHARED
/
COMMUNS.CST
/
00005_Script_gestion des sprites
< prev
next >
Wrap
Text File
|
2002-07-12
|
5KB
|
193 lines
-------------------------------------------------------------------
---------------------- PROCEDURES UTILITAIRES ---------------------
-------------------------------------------------------------------
-- Variables globales
global volumeOn -- indique si la fenΩtre de rΘglage du volume est active
global sonEnCours -- contient le nom du dernier son jouΘ
global traitLiaison
-- gestion des rollOver
-- sur une image sans curseur perso
on glisserSur piste1,piste2,ecart1,ecart2
if volumeOn<>1 then
case the paramCount of
1:-- un seul paramΦtre
set piste2 = piste1
set ecart1=0
set ecart2=0
2:-- deux paramΦtres
set ecart1=0
set ecart2=0
3:-- trois paramΦtres
set ecart2=ecart1
end case
sprite(value(member("PPGS").text)).locH = the mouseH
sprite(value(member("PPGS").text)).locV = the mouseV
repeat with i=piste1 to piste2
if rollOver(i) and sprite value(member("PPGS").text) intersects i then
afficherPistes i+ecart1, i+ecart2
else
masquerPistes i+ecart1, i+ecart2
end if
end repeat
-- les pistes de numΘro les plus ΘlevΘs sont prioritaires
repeat with i= piste2 down to 1+piste1
if the visible of sprite(i+ecart1) =1 then
repeat with j=piste1 to i-1
masquerPistes j+ecart1
if ecart2<>0 then
masquerPistes j+ecart2
end if
end repeat
end if
end repeat
end if
end glisserSur
-- sur une image avec curseur doigt et dissimulation de la piste cible
on glisserSurCM piste1,piste2,ecart1,ecart2
if volumeOn<>1 then
case the paramCount of
1:-- un seul paramΦtre
set piste2 = piste1
set ecart1=0
set ecart2=0
2:-- deux paramΦtres
set ecart1=0
set ecart2=0
3:-- trois paramΦtres
set ecart2=ecart1
end case
sprite(value(member("PPGS").text)).locH = the mouseH
sprite(value(member("PPGS").text)).locV = the mouseV
repeat with i=piste1 to piste2
if rollOver(i) and sprite value(member("PPGS").text) intersects i then
sprite(i+ecart1).cursor = 280
masquerPistes i
afficherPistes i+ecart1, i+ecart2
else
afficherPistes i
masquerPistes i+ecart1, i+ecart2
end if
end repeat
end if
end glisserSurCM
-- sur une image avec curseur doigt sans dissmulation piste cible
on glisserSurC piste1,piste2,ecart1,ecart2
if volumeOn<>1 then
case the paramCount of
1:-- un seul paramΦtre
set piste2 = piste1
set ecart1=0
set ecart2=0
2:-- deux paramΦtres
set ecart1=0
set ecart2=0
3:-- trois paramΦtres
set ecart2=ecart1
end case
sprite(value(member("PPGS").text)).locH = the mouseH
sprite(value(member("PPGS").text)).locV = the mouseV
repeat with i=piste1 to piste2
if rollOver(i) and sprite(value(member("PPGS").text)).intersects(i) then
sprite(i).cursor = 280
afficherPistes i+ecart1, i+ecart2
else
masquerPistes i+ecart1, i+ecart2
end if
end repeat
-- les pistes de numΘro les plus ΘlevΘs sont prioritaires
repeat with i= piste2 down to 1+piste1
if the visible of sprite(i+ecart1) =1 then
repeat with j=piste1 to i-1
set the visible of sprite(j+ecart1) to false
if ecart2<>0 then
set the visible of sprite(j+ecart2) to false
end if
end repeat
end if
end repeat
end if
end glisserSurC
-- masquer des pistes
on masquerPistes
repeat with i=1 to the paramCount
if value(param(i))<>0 then
set the visible of sprite(param(i)) to false
else
listePistes1 param(i),0
end if
end repeat
end masquerPistes
-- afficher des pistes
on afficherPistes
repeat with i=1 to the paramCount
if value(param(i))<>0 then
set the visible of sprite(param(i)) to true
else
listePistes1 param(i),1
end if
end repeat
end afficherPistes
-- pistes esclaves
on spritesOn
repeat with i=1 to the paramCount
if value(param(i))<>0 then
puppetSprite (param(i)), true
else
listePistes2 param(i),1
end if
end repeat
end sprites On
on spritesOff
repeat with i=1 to the paramCount
if value(param(i))<>0 then
puppetSprite (param(i)), false
else
listePistes2 param(i),0
end if
end repeat
end sprites Off
-- gestion d'une liste de pistes du type "[premiΦre piste]>[derniΦre piste]"
--> pour affichage pistes
on listePistes1 chaine,v
set n=offset(">", chaine)
set n1=value(char 1 to n-1 of chaine)
set n2=value(char n+1 to length(chaine) of chaine)
repeat with j=n1 to n2
set the visible of sprite j to v
end repeat
end listePistes1
--> pour pistes sprites
on listePistes2 chaine,v
set n=offset(">", chaine)
set n1=value(char 1 to n-1 of chaine)
set n2=value(char n+1 to length(chaine) of chaine)
repeat with j=n1 to n2
puppetSprite j,v
end repeat
end listePistes2
-- rend visibles toutes les pistes
on allVisible
repeat with i=1 to 120
afficherPistes i
end repeat
end